import Vue from 'vue'
import Router from 'vue-router'
// 前6个
// const Index = resolve => require(['pages/Index'], resolve)
// const Dynamic = resolve => require(['pages/Dynamic'], resolve)
// const GreatMan = resolve => require(['pages/GreatMan'], resolve)
// const BestManBox = resolve => require(['components/greatman/BestManBox'], resolve)
// const GreatStock = resolve => require(['pages/GreatStock'], resolve)
// const BestStockBox = resolve => require(['components/greatstock/BestStockBox'], resolve)
// const BestGroupBox = resolve => require(['components/greatstock/BestGroupBox'], resolve)
// const StockList = resolve => require(['components/greatstock/StockList'], resolve)
// const GroupList = resolve => require(['components/greatstock/GroupList'], resolve)

const Index = require('pages/Index')
const Dynamic = require('pages/Dynamic')
const GreatMan = require('pages/GreatMan')
const BestManBox =  require('components/greatman/BestManBox')
const GreatStock = require('pages/GreatStock')
const BestStockBox = require('components/greatstock/BestStockBox')
const BestGroupBox = require('components/greatstock/BestGroupBox')
const StockList = require('components/greatstock/StockList')
const GroupList = require('components/greatstock/GroupList')

// 后面那一大段的几个
// const GroupLearn = resolve => require(['pages/GroupLearn'], resolve)
// const GroupMyLearn = resolve => require(['pages/GroupMyLearn'], resolve)
// const Task = resolve => require(['pages/Task'], resolve)
// const Admirers = resolve => require(['pages/Admirers'], resolve)
// const Fans = resolve => require(['pages/Fans'], resolve)
// const Subscriptions = resolve => require(['pages/Subscriptions'], resolve)
// const Records = resolve => require(['pages/Records'], resolve)
// const BGSucc = resolve => require(['pages/game/GameBuildSucc'], resolve)
// const MoreGames = resolve => require(['pages/game/MoreGames'], resolve)
// const BuildGame = resolve => require(['pages/game/BuildGame'], resolve)

const GroupLearn = require('pages/GroupLearn')
const GroupMyLearn = require('pages/GroupMyLearn')
const Task = require('pages/Task')
const Admirers = require('pages/Admirers')
const Fans = require('pages/Fans')
const Subscriptions = require('pages/Subscriptions')
const Records =  require('pages/Records')
const BGSucc = require('pages/game/GameBuildSucc')
const MoreGames = require('pages/game/MoreGames')
const BuildGame = require('pages/game/BuildGame')

// const Game = resolve => require(['pages/Game'], resolve)
// const Trade = resolve => require(['pages/Trade'], resolve)
// const BuyIn = resolve => require(['components/trade/buy-in'], resolve)
// const SellOut = resolve => require(['components/trade/sell-out'], resolve)
// const Stock = resolve => require(['components/trade/stock'], resolve)
// const Cancel = resolve => require(['components/trade/cancel'], resolve)
// const GameStock = resolve => require(['components/trade/gamestock'], resolve)
// const GameCancel = resolve => require(['components/trade/gamecancel'], resolve)
// const DelegateFinish = resolve => require(['components/trade/after-trade/DelegateFinish'], resolve)
// const DelegateReason = resolve =>  require(['components/trade/after-trade/DelegateReason'], resolve)

const Game = require('pages/Game')
const Trade = require('pages/Trade')
const BuyIn = require('components/trade/buy-in')
const SellOut = require('components/trade/sell-out')
const Stock = require('components/trade/stock')
const Cancel = require('components/trade/cancel')
const GameStock = require('components/trade/gamestock')
const GameCancel = require('components/trade/gamecancel')
const DelegateFinish = require('components/trade/after-trade/DelegateFinish')
const DelegateReason = require('components/trade/after-trade/DelegateReason')

// const GroupDetail = resolve => require(['pages/GroupDetail'], resolve)
// const GroupIntroduce = resolve => require(['pages/GroupIntroduce'], resolve)
// const MedalsWall = resolve => require(['pages/MedalsWall'], resolve)
// const SelfDetail = resolve => require(['pages/SelfDetail'], resolve)
// const OtherDetail = resolve => require(['pages/OtherDetail'], resolve)
// const SelectionJXNG = resolve => require(['pages/SelectionJXNG'], resolve)
// const SelectionLHFP = resolve => require(['pages/SelectionLHFP'], resolve)
// const Tutorial = resolve => require(['pages/Tutorial'], resolve)
// const GroupBuild = resolve => require(['pages/GroupBuild'], resolve)
// const BuildStep1 = resolve => require(['components/group/build/BuildStep1'], resolve)
// const BuildStep2 = resolve => require(['components/group/build/BuildStep2'], resolve)
// const BuildStep3 = resolve => require(['components/group/build/BuildStep3'], resolve)
// const SearchStock = resolve => require(['components/group/build/SearchStock'], resolve)
// const GroupReason = resolve => require(['pages/GroupReason'], resolve)
// const ChooseReason = resolve => require(['components/group/res/ChooseReason'], resolve)
// const ReasonList = resolve => require(['components/group/res/ReasonList'], resolve)

const GroupDetail = require('pages/GroupDetail')
const GroupIntroduce = require('pages/GroupIntroduce')
const MedalsWall = require('pages/MedalsWall')
const SelfDetail = require('pages/SelfDetail')
const OtherDetail = require('pages/OtherDetail')
const SelectionJXNG = require('pages/SelectionJXNG')
const SelectionLHFP = require('pages/SelectionLHFP')
const Tutorial = require('pages/Tutorial')
const GroupBuild = require('pages/GroupBuild')
const BuildStep1 = require('components/group/build/BuildStep1')
const BuildStep2 = require('components/group/build/BuildStep2')
const BuildStep3 = require('components/group/build/BuildStep3')
const SearchStock = require('components/group/build/SearchStock')
const GroupReason = require('pages/GroupReason')
const ChooseReason = require('components/group/res/ChooseReason')
const ReasonList = require('components/group/res/ReasonList')

// const Comment = resolve => require(['pages/game/Comment'], resolve)
// const Search = resolve => require(['pages/search/Search'], resolve)
// const GameSelfDetail = resolve => require(['pages/game/GameSelfDetail'], resolve)
// const GameOtherDetail = resolve => require(['pages/game/GameOtherDetail'], resolve)
// const GameDetail = resolve => require(['pages/game/GameDetail'], resolve)
// const MyGames = resolve => require(['pages/game/MyGames'], resolve)
// const GameVote = resolve => require(['pages/game/GameVote'], resolve)
// const GRules = resolve => require(['pages/game/GRules'], resolve)
// const FundBase = resolve => require(['pages/fund/FundBase'], resolve)
// const FundBaseDetail = resolve => require(['pages/fund/FundBaseDetail'], resolve)
// const FundBuy = resolve => require(['pages/fund/FundBuy'], resolve)
// const FundRedeem = resolve => require(['pages/fund/FundRedeem'], resolve)
// const FundPosition = resolve => require(['pages/fund/FundPosition'], resolve)
// const FundEntrust = resolve => require(['pages/fund/FundEntrust'], resolve)
// const FundHistory = resolve => require(['pages/fund/FundHistory'], resolve)
// const FundDivide = resolve => require(['pages/fund/FundDivide'], resolve)
// const SelfAccount = resolve => require(['pages/selfaccount/SelfAccount'], resolve)
// const StockMain = resolve => require(['pages/selfaccount/StockMain'], resolve)
// const FundMain = resolve => require(['pages/selfaccount/FundMain'], resolve)
// const FinancialMain = resolve => require(['pages/selfaccount/FinancialMain'], resolve)
// const GameMain = resolve => require(['pages/selfaccount/GameMain'], resolve)
// const StockBase = resolve => require(['pages/selfaccount/StockBase'], resolve)
// const StockBaseDetail = resolve => require(['pages/selfaccount/StockBaseDetail'], resolve)

const Comment = require('pages/game/Comment')
const Search = require('pages/search/Search')
const GameSelfDetail = require('pages/game/GameSelfDetail')
const GameOtherDetail = require('pages/game/GameOtherDetail')
const GameDetail = require('pages/game/GameDetail')
const MyGames = require('pages/game/MyGames')
const GameVote = require('pages/game/GameVote')
const GRules = require('pages/game/GRules')
const FundBase = require('pages/fund/FundBase')
const FundBaseDetail = require('pages/fund/FundBaseDetail')
const FundBuy = require('pages/fund/FundBuy')
const FundRedeem = require('pages/fund/FundRedeem')
const FundPosition = require('pages/fund/FundPosition')
const FundEntrust = require('pages/fund/FundEntrust')
const FundHistory = require('pages/fund/FundHistory')
const FundDivide = require('pages/fund/FundDivide')
const SelfAccount = require('pages/selfaccount/SelfAccount')
const StockMain = require('pages/selfaccount/StockMain')
const FundMain = require('pages/selfaccount/FundMain')
const FinancialMain = require('pages/selfaccount/FinancialMain')
const GameMain = require('pages/selfaccount/GameMain')
const StockBase = require('pages/selfaccount/StockBase')
const StockBaseDetail = require('pages/selfaccount/StockBaseDetail')

// 团队赛
const TeamGameDetail = require('components/teamGame/TeamGameDetail')
const TeamDetail = require('components/teamGame/TeamDetail')
const Announcement = require('components/teamGame/children/Announcement')

Vue.use(Router)

export default new Router({
  //mode: 'history',
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      children: [
        {
          path: '/dynamic',
          name: 'Dynamic',
          alias: '/',
          component: Dynamic
        }, {
          path: '/greatman',
          name: 'GreatMan',
          component: GreatMan,
          children: [
            {
              path: '/greatman/bestmanbox/',
              component: BestManBox,
              children: [
                {
                  path: '/greatman/bestmanbox/:menuindex',
                  component: BestManBox,
                }
              ]
            }
          ]
        }, {
          path: '/greatstock/',
          name: 'GreatStock',
          component: GreatStock,
          children: [
            {
              path: '/greatstock/beststockbox/',
              component: BestStockBox,
              children: [
                {
                  path: '/greatstock/beststockbox/:menuindex',
                  component: StockList
                }
              ]
            },
            {
              path: '/greatstock/bestgroupbox/',
              component: BestGroupBox,
              children: [
                {
                  path: '/greatstock/bestgroupbox/:menuindex',
                  component: GroupList
                }
              ]
            }
          ]
        },
        {
          path: '/game',
          name: 'Game',
          component: Game
        }
      ]
    },
    {
      path: '/trade',
      name: 'Trade',
      component: Trade,
      children: [
        {// 买入页面，可接受参数:gameId、stockCode、stockName、marketCd
          path: 'buyin',
          name: 'BuyIn',
          component: BuyIn
        },
        {// 卖出页面,可接受参数:gameId、stockCode、stockName、marketCd
          path: 'sellout',
          name: 'SellOut',
          component: SellOut
        },
        {// 持仓页面，可接受参数:gameId
          path: 'stock',
          name: 'Stock',
          component: Stock
        },
        {// 委托撤销页面，可接受参数:gameId
          path: 'cancel',
          name: 'Cancel',
          component: Cancel
        },
        {// 比赛持仓页， 可接受参数:gameId
          path: 'gamestock',
          name: 'GameStock',
          component: GameStock
        },
        {// 比赛撤销页，可接受参数:gameId
          path: 'gamecancel',
          name: 'GameCancel',
          component: GameCancel
        }
      ]
    },
    {
      path: '/team-game/game-detail',
      name: 'TeamGameDetail',
      component: TeamGameDetail,
      children: [
        {
          path: 'announcement',
          name: 'Announcement',
          component: Announcement
        },
      ]
    },
    {
      path: '/team-game/team-detail',
      name: 'TeamDetail',
      component: TeamDetail
    },
    {
      path: '/after-trade/delegate-finish',
      name: 'DelegateFinish',
      component: DelegateFinish
    },
    {
      path: '/after-trade/delegate-reason',
      name: 'DelegateReason',
      component: DelegateReason
    },
    {path: '/groupdetail', "name": 'GroupDetail', component: GroupDetail},
    {path: '/groupintroduce', "name": 'GroupIntroduce', component: GroupIntroduce},
    {path: '/medalswall', "name": 'MedalsWall', component: MedalsWall},
    {path: '/selfdetail', "name": 'SelfDetail', component: SelfDetail},
    {path: '/otherdetail', "name": 'OtherDetail', component: OtherDetail},
    {path: '/selectionjxng', "name": 'SelectionJXNG', component: SelectionJXNG},
    {path: '/selectionlhfp', "name": 'SelectionLHFP', component: SelectionLHFP},
    {path: '/tutorial', "name": 'Tutorial', component: Tutorial},
    {
      path: '/buildgroup',
      name: 'GroupBuild',
      component: GroupBuild,
      children: [
        {
          path: '/buildgroup/buildstep1',
          name: 'BuildStep1',
          component: BuildStep1
        },
        {
          path: '/buildgroup/buildstep2',
          name: 'BuildStep2',
          component: BuildStep2
        },
        {
          path: '/buildgroup/buildstep3',
          name: 'BuildStep3',
          component: BuildStep3
        },
        {
          path: '/buildgroup/searchstock',
          name: 'SearchStock',
          component: SearchStock
        }
      ]
    },
    {
      path: '/groupreason',
      name: 'GroupReason',
      component: GroupReason,
      children: [
        {
          path: '/groupreason/choosereason',
          name: 'ChooseReason',
          component: ChooseReason
        },
        {
          path: '/groupreason/reasonlist',
          name: 'ReasonList',
          component: ReasonList
        }
      ]
    },

    //{path: '/modaltest', name: 'ModalTest', component: require('components/modal/test/ModalTest')}, //所有弹窗的测试页，测试时可取消注释
    {path: '/learngroup', name: 'GroupLearn', component: GroupLearn},
    {path: '/mylearngroup', name: 'GroupMyLearn', component: GroupMyLearn},
    {path: '/task', name: 'Task', component: Task},
    {path: '/admirers', name: 'Admirers', component: Admirers},
    {path: '/fans', name: 'Fans', component: Fans},
    {path: '/subscriptions', name: 'Subscriptions', component: Subscriptions},
    {path: '/records', name: 'Records', component: Records},
    {path: '/game/succ', name: 'BGSucc', component: BGSucc},
    {path: '/game/comment', component: Comment},
    {path: '/game/moregames',name:'MoreGames', component: MoreGames},
    {path: '/game/buildgame',name:'BuildGame', component: BuildGame},
    {path: '/search/search',name:'Search', component: Search},
    {path: '/game/gameselfdetail',name:'GameSelfDetail', component: GameSelfDetail},
    {path: '/game/gameotherdetail',name:'GameOtherDetail', component: GameOtherDetail},
    {path: '/game/gamedetail',name:'GameDetail', component: GameDetail},
    {path: '/game/mygames',name:'MyGames', component: MyGames},
    {path: '/game/gamevote', name: 'GameVote', component: GameVote},
    {path: '/game/rules', name:'GRules', component: GRules},
    {path: '/fundbase', name:'FundBase', component: FundBase},//基金基础
    {path: '/fundbasedetail', name:'FundBaseDetail', component: FundBaseDetail},//基金基础详情页
    {path: '/fundbuy', name:'FundBuy', component: FundBuy},//基金购买
    {path: '/fundredeem', name:'FundRedeem', component: FundRedeem},//基金赎回
    {path: '/fundposition', name:'FundPosition', component: FundPosition},//基金持仓
    {path: '/fundentrust', name:'FundEntrust', component: FundEntrust},//基金-委托查询
    {path: '/fundhistory', name:'FundHistory', component: FundHistory},//基金-历史成交
    {path: '/funddivide', name:'FundDivide', component: FundDivide},//基金-分红方式
    {path: '/selfaccount', name:'SelfAccount', component: SelfAccount},//个人账户总览
    {path: '/stockmain', name:'StockMain', component: StockMain},//股票主界面
    {path: '/fundmain', name:'FundMain', component: FundMain},//基金主界面
    {path: '/financialmain', name:'FinancialMain', component: FinancialMain},//两融主界面
    {path: '/gamemain', name:'GameMain', component: GameMain},//账户总览-比赛主界面
    {path: '/stockbase', name:'StockBase', component: StockMain},//炒股基础页面
    {path: '/stockbasedetail', name:'StockBaseDetail', component: StockBaseDetail}//炒股基础详情页面
  ]
})
